﻿////////////////////////////////////////////////////
// 
//  @GeomPair class
//  @author: kester
// 
////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using FarseerGames.FarseerPhysics.Dynamics;
using FarseerGames.FarseerPhysics.Collisions;

namespace FarseerGames.AdvancedSamples.Demos.DemoShare
{
    class GeomPair
    {
        private Geom _geom1;
        private Geom _geom2;
        private Vector2 _difference;
        private float _rotation;
        private Vector2 _origin;

        public GeomPair()
        {
            this._geom1 = null;
            this._geom2 = null;
        }

        public GeomPair(Geom b1, Geom b2)
        {
            this._geom1 = b1;
            this._geom2 = b2;
        }

        public Vector2 getGeom1Position()
        {
            return this._geom1.Position;
        }

        public Vector2 getGeom2Position()
        {
            return this._geom2.Position;
        }

        public void update(float r, Vector2 d)
        {
            this._origin = Vector2.Add(_geom1.Position,
                        Vector2.Multiply(Vector2.Subtract(_geom2.Position, _geom1.Position),
                        0.5f));
            this._rotation = r;
            this._difference = d;
        }
        
        public Vector2 getOriginPosition()
        {
            return (this._origin);                    
        }

        public void setOrigin(Vector2 orig)
        {
            this._origin = orig;
        }

        public Vector2 getDifference()
        {
            return this._difference;
        }

        public void setDifference(Vector2 d)
        {
            this._difference = d;
        }

        public float getRotation()
        {
            return this._rotation;
        }

        public void setRotation(float r)
        {
            this._rotation = r;
        }


    }
}
